import Login from './../Login'
import Home from './../Home'
import Dashboard from '@/components/Dashboard'
import Template from '@/components/Template'
import Enterprise from '@/components/enterprise/Enterprise'
import AddEnterprise from '@/components/enterprise/AddEnterprise'
import Project from '@/components/project/Project'
import AddProject from '@/components/project/AddProject'
import ProjectDetail from '@/components/project/ProjectDetail'
import Device from '@/components/device/Device'
import DeviceCurrentData from '@/components/device/DeviceCurrentData'
import ItemHistroyData from '@/components/device/ItemHistroyData'

let routes = [
  {
    path: '/login',
    name: 'Login',
    component: Login,
    hidden: true
  },
  {
    path: '/',
    redirect: '/project',
    name: 'Project',
    component: Project,
    hidden: true
  },
  {
    path: '/dashboard',
    name: 'Dashboard',
    component: Dashboard,
    hidden: true
  },
  {
    path: '/',
    component: Home,
    name: '项目',
    iconCls: 'el-icon-message', // 图标样式class
    children: [
      { path: '/project', component: Project, name: '项目管理' },
      { path: '/project/addProject', component: AddProject, name: '新建项目' },
      { path: '/project/detail/:id', component: ProjectDetail, name: '项目详情', hidden: true }
    ]
  },
  {
    path: '/',
    component: Home,
    name: '网关',
    iconCls: 'el-icon-picture', // 图标样式class
    children: [
      { path: '/device', component: Device, name: '网关管理' },
      { path: '/device/currentData/:id', component: DeviceCurrentData, name: '实时数据', hidden: true },
      { path: '/device/itemHistroyData/:deviceid/:itemid/:itemname', component: ItemHistroyData, name: '历史数据', hidden: true }
    ]
  },
  {
    path: '/',
    component: Home,
    name: '报表',
    iconCls: 'el-icon-document',
    children: [
      { path: '/report', component: Template, name: '报表管理' }
    ]
  },
  {
    path: '/',
    component: Home,
    name: '企业',
    iconCls: 'el-icon-menu',
    children: [
      { path: '/enterprise', component: Enterprise, name: '企业管理' },
      { path: '/enterprise/add', component: AddEnterprise, name: '新建企业', key: 'AddEnterprise' }
    ]
  },
  {
    path: '/',
    component: Home,
    name: '用户',
    iconCls: 'el-icon-star-off',
    children: [
      { path: '/user', component: Template, name: '用户管理' },
      { path: '/permisson', component: Template, name: '权限管理' }
    ]
  },
  {
    path: '/',
    component: Home,
    name: '设置',
    iconCls: 'el-icon-setting',
    children: [
      { path: '/setting', component: Template, name: '系统设置' }
    ]
  }
]
export default routes
